package com.leo.slice;

import com.leo.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;

public class ShapeAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_shape);

        findComponentById(ResourceTable.Id_ShadowLayout_image).setClickedListener(v -> {
            v.setSelected(!v.isSelected());
        });
        findComponentById(ResourceTable.Id_shadowLayout_bar_left).setClickedListener(v -> {
            terminate();
        });

        findComponentById(ResourceTable.Id_shadowLayout_select).setClickedListener(v -> {
            v.setSelected(!v.isSelected());
        });

        findComponentById(ResourceTable.Id_shadowLayout_bindView).setClickedListener(v -> {
            v.setSelected(!v.isSelected());
        });
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
